package com.union.session;

import java.util.ArrayList;
import java.util.List;

import com.union.dao.PCDAO;
import com.union.entitybean.Category;
import com.union.entitybean.PC;
import com.union.entitybean.Person;

public class CategoryBean extends BaseBean {
	public void save(Category category) {
		if (category.getCateId() == null)
			categoryDAO.save(category);
		else
			categoryDAO.merge(category);
	}

	public List findAll() {
		List orgList = new ArrayList();
		orgList = categoryDAO.findAll();

		return orgList;
	}

	public void del(Category category) {
		categoryDAO.delete(category);
	}
	
	public List findByPersonId(int personId){
		return pcDAO.findByPersonId(personId);
	}
	
}
